Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • use 3d surface graph to explain in*the interaction effect

    Dear all,@Nick Cox Can i use stata command to plot a 3d surface graph to explain in the interaction effect? For example,My model is y=b0+b1*x1+b2*x1*x2+e, can I plot a graph to explain the effect of x2 to the effect of x1 on y?Such as this picture:
    Attached Files
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

  • #2
    I do not think you can do that directly in Stata, unless you use exploit the capabilities given by the integration of python in Stata. See this example for instance: https://blog.stata.com/2020/09/14/st...l-predictions/

    Comment


    • #3
      There is the community-contributed surface command but you need to invest some effort yourself to set up a data set with the effects you want to plot:
      Code:
      ssc install surface
      The graph3d command may also be helpful:
      Code:
      ssc install graph3d
      Not a surface but possibly of use as well are twoway contour graphs that are part of official Stata.
      Last edited by Sebastian Kripfganz; 17 Jan 2021, 02:17.
      https://www.kripfganz.de/stata/

      Comment


      • #4
        Thank you for your kind help.@Dario Maimone Ansaldo Patti @Sebastian Kripfganz
        Best regards.

        Raymond Zhang
        Stata 17.0,MP

        Comment

        Working...
        X